#pragma once

#include <vtkSmartPointer.h>
#include <unordered_map>
#include <gp_Pnt.hxx>

class MainWindow;
class vtkActor;

// 用于管理temp sphere actor的对象池
class TempActorManager
{
public:
	TempActorManager(MainWindow* mainWindow);
	~TempActorManager();

	uint8_t GetUnallocatedActor(float radius = m_defaultRadius);// 获得一个未分配地actor
    void FreeActor(uint8_t actorId);// 释放一个actor
	void SetActorVisible(uint8_t actorId, bool bVisible, const gp_Pnt& position);// 设置指定actor的可见性

	static float m_defaultRadius;

protected:
	MainWindow* m_mainWindow;

	std::unordered_map<uint8_t, vtkSmartPointer<vtkActor>> m_allocatedActors;// 已经分配的actor
	std::unordered_map<uint8_t, vtkSmartPointer<vtkActor>> m_unallocatedActors;// 未分配的actor

};

